// vue.config.js
const path = require('path');

module.exports = {
  pwa: {
    iconPaths: {
      favicon32: 'favicon.ico',
      favicon16: 'favicon.ico',
      appleTouchIcon: 'favicon.ico',
      maskIcon: 'favicon.ico',
      msTileImage: 'favicon.ico',
    },
  },
  devServer: {
    proxy: {
      '/mock': {
        target: 'https://mock.apipost.cn/app/mock/project/f65c9e71-46b8-4fe7-b52d-e02deb224e24/',
        pathRewrite: { '^/mock': '' },
        changeOrigin: true,
      },
      '/qa': {
        target: 'http://qa-tio-abc-tiv.patsnap.info',
        pathRewrite: { '^/qa': '' },
        changeOrigin: true,
      },
      '/api': {
        // target: 'http://ci-tio-abc-tiv.patsnap.info',
        target: 'http://492cg2379pp9.vicp.fun',
        changeOrigin: true,
      },
    },
  },
  configureWebpack: {
    resolve: {
      alias: {
        '@src': path.resolve(__dirname, 'src'),
        '@assets': path.resolve(__dirname, 'src/assets'),
        '@maps': path.resolve(__dirname, 'src/maps'),
        '@img': path.resolve(__dirname, 'src/assets/img'),
        '@config': path.resolve(__dirname, 'src/config'),
        '@utils': path.resolve(__dirname, 'src/utils'),
        '@service': path.resolve(__dirname, 'src/service'),
        '@common': path.resolve(__dirname, 'src/components/common'),
      },
    },
  },
};
